package cn.xuexiyuan.springstudy.core.demo04;

import cn.xuexiyuan.springstudy.core.demo04.entity.DatePrefix;
import cn.xuexiyuan.springstudy.core.demo04.service.SequenceGenerator;
import cn.xuexiyuan.springstudy.core.demo04.entity.TimePrefix;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.xuexiyuan.springstudy.core.demo04");
        SequenceGenerator seq = context.getBean(SequenceGenerator.class);
        System.out.println(seq.getSequence());
        System.out.println(seq.getSequence());
        System.out.println(seq.getSequence());
        System.out.println(seq.getSequence(TimePrefix.class));
        System.out.println(seq.getSequence(DatePrefix.class));
        System.out.println(seq.getSequence(DatePrefix.class));
        seq.printPrefix();
    }
}
